import { network } from '@/utils';
import { TableListParams, SaveOrUpdateParams } from './data';

import { basic } from '../../../../../config/Apis';

export async function queryPartitionManagement(params: TableListParams) {
  return network.get(basic.region_list, {
    params,
  });
}

export async function queryLogistics(params: TableListParams) {
  return network.get(basic.logis_list, {
    params,
  });
}

export async function queryGardenList(params: TableListParams) {
  return network.get(basic.garden_list, {
    params,
  });
}

export async function operChangeStatus(params: { id: number, status: number }) {
  return network.put(basic.region_status, {
    data: params,
  });
}

export async function savePartition(params: SaveOrUpdateParams | any) {
  return network.post(basic.region, params);
}

export async function updatePartition(params: SaveOrUpdateParams | any) {
  return network.put(basic.region, params);
}
